package io.renren.modules.generator.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.generator.dao.BsnMentorDao;
import io.renren.modules.generator.entity.BsnMentorEntity;
import io.renren.modules.generator.service.BsnMentorService;


@Service("bsnMentorService")
public class BsnMentorServiceImpl extends ServiceImpl<BsnMentorDao, BsnMentorEntity> implements BsnMentorService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<BsnMentorEntity> page = this.selectPage(
                new Query<BsnMentorEntity>(params).getPage(),
                new EntityWrapper<BsnMentorEntity>()
        );

        return new PageUtils(page);
    }
    
    @Override
    public BsnMentorEntity selectByLoginId(String loginId) {
    	BsnMentorEntity entity = new BsnMentorEntity();
    	entity.setLoginId(loginId);
    	return baseMapper.selectOne(entity);
    }
}
